-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the policy es_model helps to unique policy data #747
Conversation
action_days: str | ||
skip_policy: str | ||
cost: float = '' | ||
savings: float = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yearly_saving
@athiruma there is conflict, pls fix it |
running_days: int = '' | ||
create_date: str = '' | ||
|
||
def __post_init__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the purpose of post init, why not to use init ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It helps to init the variables after initialization of variables in the init method.
@staticmethod | ||
def convert_to_title_case(snake_case: str): | ||
""" | ||
This method convert lower case to title case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
converts
|
||
@dataclass | ||
class PolicyEsMetaData(dict): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u add the class purpose ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
||
def __post_init__(self): | ||
""" | ||
This method initialize the IndexId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -130,3 +131,17 @@ def get_start_and_end_datetime(days: int) -> [datetime, datetime]: | |||
end_date = datetime.utcnow() | |||
start_date = end_date - timedelta(days=days) | |||
return start_date, end_date | |||
|
|||
@staticmethod | |||
def convert_to_title_case(snake_case: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this method is only for testing purpose, I think it should be under test directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it helps to convert lower case to title case, that is being push to the ElasticSearch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@athiruma, WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a testing method.
I have resolved the comments. |
|
||
|
||
@dataclass | ||
class PolicyEsData(dict): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change PolicyEsMetaData
public_cloud: str | ||
action_days: str | ||
skip_policy: str | ||
cost: float = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cost_unit
action_days: str | ||
skip_policy: str | ||
cost: float = '' | ||
savings: float = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yearly_cost_savings
running_days: int = '' | ||
create_date: str = '' | ||
|
||
def __post_init__(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It helps to init the variables after initialization of variables in the init method.
|
||
@dataclass | ||
class PolicyEsMetaData(dict): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
||
def __post_init__(self): | ||
""" | ||
This method initialize the IndexId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -130,3 +131,17 @@ def get_start_and_end_datetime(days: int) -> [datetime, datetime]: | |||
end_date = datetime.utcnow() | |||
start_date = end_date - timedelta(days=days) | |||
return start_date, end_date | |||
|
|||
@staticmethod | |||
def convert_to_title_case(snake_case: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it helps to convert lower case to title case, that is being push to the ElasticSearch
@@ -130,3 +131,17 @@ def get_start_and_end_datetime(days: int) -> [datetime, datetime]: | |||
end_date = datetime.utcnow() | |||
start_date = end_date - timedelta(days=days) | |||
return start_date, end_date | |||
|
|||
@staticmethod | |||
def convert_to_title_case(snake_case: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a testing method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
Type of change
Note: Fill x in []
Description
Creating PolicyEsModal helps to create the unique data to upload to the elastic_search
For security reasons, all pull requests need to be approved first before running any automated CI